package model.hospital;

import model.assessment.Assessment;
import model.assessment.Test;

import java.util.Date;
import java.util.Objects;

public class Patient {
    private String name;
    private String sex;
    private Date birthday;
    private String idNumber;
    private String tel;
    private String emergencyContact;
    private String emergencyTel;
    private Assessment assessment = new Assessment();
    private String uid;
    private String doctorUID;
    private String bedUID;
    private boolean isDeleted;

    public void addTest(Test test){
        assessment.addTest(test);
    }

    public String getBedUID() {
        return bedUID;
    }

    public void setBedUID(String bedUID) {
        this.bedUID = bedUID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getEmergencyContact() {
        return emergencyContact;
    }

    public void setEmergencyContact(String emergencyContact) {
        this.emergencyContact = emergencyContact;
    }

    public String getEmergencyTel() {
        return emergencyTel;
    }

    public void setEmergencyTel(String emergencyTel) {
        this.emergencyTel = emergencyTel;
    }

    public Assessment getAssessment() {
        return assessment;
    }

    public void setAssessment(Assessment assessment) {
        this.assessment = assessment;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getDoctorUID() {
        return doctorUID;
    }

    public void setDoctorUID(String doctorUID) {
        this.doctorUID = doctorUID;
    }

    public boolean isDeleted() {
        return isDeleted;
    }

    public void setDeleted(boolean deleted) {
        isDeleted = deleted;
    }

    public Patient(String name, String sex, Date birthday,
                   String idNumber, String tel, String emergencyContact,
                   String emergencyTel, String uid, String doctorUID) {
        this.name = name;
        this.sex = sex;
        this.birthday = birthday;
        this.idNumber = idNumber;
        this.tel = tel;
        this.emergencyContact = emergencyContact;
        this.emergencyTel = emergencyTel;
        this.assessment = new Assessment();
        this.uid = uid;
        this.doctorUID = doctorUID;
    }

    public Patient(String uid) {
        this.uid = uid;
    }

    public Patient() {
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Patient patient = (Patient) o;
        return isDeleted == patient.isDeleted && Objects.equals(uid, patient.uid);
    }

    @Override
    public String toString() {
        return "Patient{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", birthday=" + birthday +
                ", idNumber='" + idNumber + '\'' +
                ", tel='" + tel + '\'' +
                ", emergencyContact='" + emergencyContact + '\'' +
                ", emergencyTel='" + emergencyTel + '\'' +
                ", assessment=" + assessment +
                ", uid='" + uid + '\'' +
                ", doctorUID='" + doctorUID + '\'' +
                ", bedUID='" + bedUID + '\'' +
                '}';
    }
}
